package com.my.cd.builder;

/**
 * 抽象生成器基类
 * 实现通用方法处理
 */
public abstract class AbstractBuilder implements Builder {

    protected Vacation vacation;//持有假期计划类的引用

    public AbstractBuilder(String startDate) {
        vacation = new Vacation(startDate);
    }

    public Vacation getVacation() {
        return vacation;
    }

    public Builder addHotel(String hotel) {
        vacation.setHotel(hotel);
        return this;
    }

    public Builder addTicket(String ticket) {
        vacation.addTicket(ticket);
        return this;
    }

    public Builder addEvent(String event) {
        vacation.addEvent(event);
        return this;
    }

}
